
package com.jiajiankang.more;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.jiajiankang.R;
import com.jiajiankang.index.Main;
import com.jiajiankang.index.sixButton;
import com.jiajiankang.myspace.MyFavor;
import com.jiajiankang.serviceregister.ServiceRegister;

public class More extends sixButton {
	private Button btna;
	private Button btnb;
	private Button btnc;
	private Button btnd;
	private Button btne;
	private Button btnj;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.more);
		btna = (Button) findViewById(R.id.more_myfavor);
		btnb = (Button) findViewById(R.id.more_history);
		btnc = (Button) findViewById(R.id.more_servicestation);
		btnd = (Button) findViewById(R.id.more_healthsquare);
		btne = (Button) findViewById(R.id.more_servicestationapply);
		btnj = (Button) findViewById(R.id.more_quit);

		btna.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(More.this, MyFavor.class);
				startActivity(intent);

			}
		});
		btnb.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(More.this, MyHistory.class);
				startActivity(intent);

			}
		});
		btnc.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(More.this, EndMap.class);
				startActivity(intent);

			}
		});
		btnd.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(More.this, HealthInfo.class);
				startActivity(intent);

			}
		});
		btne.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(More.this, ServiceRegister.class);
				startActivity(intent);

			}
		});
		btne.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(More.this, ServiceRegister.class);
				startActivity(intent);

			}
		});
		btnj.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(Intent.ACTION_MAIN);   
				intent.addCategory(Intent.CATEGORY_HOME);   
				intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
				startActivity(intent);   
				android.os.Process.killProcess(android.os.Process.myPid());   
				
			}
		});
		myClickHandler();
		six_more.setImageDrawable(getResources().getDrawable(R.drawable.six_more_2));
		six_more.setBackgroundResource(R.drawable.btn_press);
		
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		if(keyCode == KeyEvent.KEYCODE_BACK)
		{
			Intent intent= new Intent(More.this,Main.class);
			startActivity(intent);
			return true;
		}
		else 
			return super.onKeyDown(keyCode, event);
		
	}
}
